<template>
	<view class="all">
		<fui-search-bar background="#112858" radius="36" searchColor="#FFB703" @search="search"></fui-search-bar>
		<view style="font-weight: 600;font-size: 40rpx;text-align: center;color:#fff;" v-if="result == 2">查找结果</view>

		<view style="width: 100%;font-weight: 600;font-size: 40rpx;text-align: center;color:#fff;margin-top: 200rpx;"
			v-if="type == 1">
			<image src="../../static/wu.png"></image>
		</view>
		<view style="padding-bottom: 30rpx;overflow: auto;width: 100%;height: 85vh;" v-else>
			
			<!-- //论坛 -->
			<view class="square" v-for="(item, index) in plateList" :key="index">
				<view class="flex p-xs margin-bottom-sm mb-sm">
					<view class="flex-quadruple padding-sm margin-xs radius" style="padding-right: 0 !important;">
						<view class='headimg'>
							<image style="width: 100%;height: 100%;border-radius: 100rpx;" :src="item.avatar"></image>
						</view>
					</view>
					<view class="flex-sub padding-sm margin-xs radius"
						style="width: 56% !important;padding-left: 0 !important;">
						<view style="font-size: 45rpx;color: white;">{{item.username}}</view>
						<view style="font-size: 35rpx;color: #b1c2d7;">{{item.create_time}}</view>
					</view>
					<view style="display: flex;padding: 25rpx 20rpx 0 0;" v-if="item.is_author == 1">
						<view style="font-size: 30rpx;color:#fff;padding-right: 20rpx;" @click="deletePost(item)">删除
						</view>
						<view style="font-size: 30rpx;color:#fff;" @click="updatePost(item)">修改</view>
					</view>
				</view>
				<view class="flex p-xs margin-bottom-sm mb-sm" style="margin-top: -50rpx;">
					<view class="flex-sub padding-sm margin-xs radius" style="width: 98%;">
						<rich-text class="rich-text" style="width: 98%;font-size: 36rpx;color: white;"
							:nodes="item.post_content"></rich-text>
					</view>
				</view>
				<view>
					<view v-for="(img,img_index) in item.file_img" :key="img_index" v-if="item.file_img && item.file_img.length > 0" style="display: inline-block;width: 26%;height: 200rpx;padding: 0 10rpx;">
						<image style="width: 100%;height: 100%;margin-left: 30rpx;" @click="tankuang(img,item.file_img)" :src="img" ></image>
					</view>
				</view>
				<view style="display: flex; justify-content: center; align-items: center;"
					v-for="(video,index) in item.file_video">
					<video :src="video"></video>
				</view>
				<view v-for="(datafile,ind) in item.file_data">
					<view style="color:#fff; padding:10rpx 0 10rpx 20rpx;" @click="downloadFiles(ind,datafile.url)">
						{{datafile.filename}}</view>
				</view>
			
				<view class="introduce" v-for="(item1,index1) in forum_comment.list" :key="index1"
					v-if="item.id == forum_id">
					<view class="introduce_comment">
						<view>
							<view
								style="font-size: 35rpx;color: #1EEBE6;display: flex;justify-content: space-between;align-items: center;">
								<view style="display: flex;justify-content: space-between;align-items: center;">
									<view class="cu-avatar round margin-left"
										:style="{'background-image':'url('+ item1.user.avatar +')'}"></view>
									<view style="font-size: 35rpx;">{{item1.user.nickname}}</view>
								</view>
								<view style="display: flex;justify-content: space-between;align-items: center;">
									<view style="color: #fff;font-size: 30rpx;margin-right: 20rpx;"
										@tap="showModal1(item1.aid,item1.id)" data-target="menuModal1">评论</view>
									<view style="color: #fff;font-size: 30rpx;margin-right: 20rpx;"
										@click.stop="deleteComment(item1.id)" v-if='item1.is_author == 1'>删除</view>
									<view style="color: #fff;font-size: 30rpx;margin-right: 20rpx;"
										@tap="showModal3(item1.aid,item1.id,item1)" data-target="menuModal3"
										v-if='item1.is_author == 1'>修改</view>
								</view>
							</view>
							<view style="margin-left: 20rpx;padding-top: 15rpx;">
								<rich-text style="color: #fff;" :nodes="item1.content_text"></rich-text>
								<view>
									<image style="width: 26%;height: 200rpx;margin-left: 30rpx;" :src="img"
										v-for="(img,index) in item1.content_files_img" :key="index"></image>
								</view>
							</view>
							<view class="cu-modal" :class="modalName1=='menuModal1'?'show':''" @tap="hideModal1">
								<view class="cu-dialog" @tap.stop>
									<view style="padding: 20rpx 0 30rpx 30rpx;font-size: 40rpx;font-weight: 600;">发表评论
									</view>
									<view class="flex p-xs margin-bottom-sm mb-sm" style="">
										<view class="flex-quadruple padding-sm margin-xs radius"
											style="padding-right: 0;">
											<view class='headimg1'>
												<image style="width: 100%;height: 100%;border-radius: 100rpx;"
													:src="userinfo.avatar"></image>
											</view>
										</view>
										<view class="flex-sub padding-sm margin-xs radius"
											style="padding-left: 0;position: relative;">
											<input class="inputstyle" v-model="text2" placeholder="友善评论" style="color:#000000;"></input>
											<image
												style="width: 50rpx;height:50rpx;position: absolute;top:30rpx;right: 30rpx;z-index:999;"
												@click="ChooseImage(item.id,2)" src="@/static/upimg.png"></image>
										</view>
										<view
											style="padding: 20rpx 20rpx 0 0;font-size: 40rpx;color: #000000;margin-top: 18rpx;"
											@click="comment_first(aid,pinglun_id)">
											发送
										</view>
									</view>
									<view style="width: 100%;height: 200rpx;" v-if="imgLists.length > 0">
										<view style="display: inline-block;position: relative;"
											v-for="(img,index2) in imgLists" :key="index2">
											<image style="width: 160rpx;height: 160rpx;float: left;padding-left: 20rpx;"
												:src="img"></image>
											<image
												style="width: 30rpx;height: 30rpx;position: absolute;top: -15rpx;right: -15rpx;"
												@click="delimg(index2)" src="@/static/close.png"></image>
										</view>
									</view>
								</view>
							</view>
						</view>
						<view class="introduce_second" style="margin-top: 15rpx;">
							<rich-text style="color: #fff;" :nodes="item.content"></rich-text>
						</view>
			
						<view class="introduce_comment" v-for="(item2,index2) in item1.children" :key="index2"
							style="margin-left: 25rpx;width: 95%;">
							<view>
								<view
									style="font-size: 35rpx;color: #1EEBE6;display: flex;justify-content: space-between;align-items: center;">
									<view style="display: flex;justify-content: space-between;align-items: center;">
										<view class="cu-avatar round margin-left"
											:style="{'background-image':'url('+ item2.user.avatar +')'}"></view>
										<view style="font-size: 35rpx;">{{item2.user.nickname}}</view>
									</view>
									<view style="display: flex;justify-content: space-between;align-items: center;">
										<view style="color: #fff;font-size: 30rpx;margin-right: 20rpx;"
											@tap="showModal2(item2.aid,item1.id)" data-target="menuModal1">评论</view>
										<view style="color: #fff;font-size: 30rpx;margin-right: 20rpx;"
											@click.stop="deleteComment(item2.id)" v-if='item2.is_author == 1'>删除</view>
										<view style="color: #fff;font-size: 30rpx;margin-right: 20rpx;"
											@tap="showModal3(item2.aid,item2.id,item2)" v-if='item2.is_author == 1'
											data-target="menuModal3">修改</view>
									</view>
								</view>
								<view style="margin-left: 20rpx;padding-top: 15rpx;">
									<!-- <rich-text style="color: #fff;" :nodes="item2.content"></rich-text> -->
									<rich-text style="color: #fff;" :nodes="item2.content_text"></rich-text>
									<view>
										<image style="width: 26%;height: 200rpx;margin-left: 30rpx;" :src="img"
											v-for="(img,index3) in item2.content_files_img" :key="index3"></image>
									</view>
								</view>
								<view class="cu-modal" :class="modalName2=='menuModal2'?'show':''" @tap="hideModal2">
									<view class="cu-dialog" @tap.stop>
										<view style="padding: 20rpx 0 30rpx 30rpx;font-size: 40rpx;font-weight: 600;">
											发表评论</view>
										<view class="flex p-xs margin-bottom-sm mb-sm" style="">
											<view class="flex-quadruple padding-sm margin-xs radius"
												style="padding-right: 0;">
												<view class='headimg1'>
													<image style="width: 100%;height: 100%;border-radius: 100rpx;"
														:src="userinfo.avatar"></image>
												</view>
											</view>
			
											<view class="flex-sub padding-sm margin-xs radius"
												style="padding-left: 0;position: relative;">
												<input class="inputstyle" v-model="text3" placeholder="友善评论" style="color:#000000;"></input>
												<image
													style="width: 50rpx;height:50rpx;position: absolute;top:30rpx;right: 30rpx;z-index:999;"
													@click="ChooseImage(item.id,3)" src="@/static/upimg.png"></image>
											</view>
			
											<view
												style="padding: 20rpx 20rpx 0 0;font-size: 40rpx;color: #000000;margin-top: 18rpx;"
												@click="comment_second(aid,pinglun_id)">
												发送
											</view>
										</view>
										<view style="width: 100%;height: 200rpx;" v-if="imgListss.length > 0">
											<view style="display: inline-block;position: relative;"
												v-for="(img,index4) in imgListss" :key="index4">
												<image
													style="width: 160rpx;height: 160rpx;float: left;padding-left: 20rpx;"
													:src="img"></image>
												<image
													style="width: 30rpx;height: 30rpx;position: absolute;top: -15rpx;right: -15rpx;"
													@click="delimg(index4)" src="@/static/close.png"></image>
											</view>
										</view>
									</view>
								</view>
							</view>
							<view class="introduce_second" style="margin-top: 15rpx;">
								<rich-text style="color: #fff;" :nodes="item.content"></rich-text>
							</view>
						</view>
			
					</view>
				</view>
				<view style="font-size: 25rpx;color:#fff;padding: 0 0 50rpx 20rpx;" @click="see_more(item.id)">查看更多评论
				</view>
			
				<view class="flex p-xs margin-bottom-sm mb-sm" style="margin-top: -50rpx;">
					<view class="flex-quadruple padding-sm margin-xs radius" style="padding-right: 0;">
						<view class='headimg1'>
							<image style="width: 100%;height: 100%;border-radius: 100rpx;" :src="userinfo.avatar">
							</image>
						</view>
					</view>
					<view class="flex-sub padding-sm margin-xs radius" style="padding-left: 0;position: relative;">
						<input class="inputstyle" v-model="commentText[item.id]" placeholder="友善评论" style="color:#000000;"></input>
						<image style="width: 50rpx;height:50rpx;position: absolute;top:30rpx;right: 30rpx;z-index:999;"
							@click="ChooseImage(item.id,1)" src="@/static/upimg.png"></image>
					</view>
					<view style="padding: 20rpx 20rpx 0 0;font-size: 40rpx;color: #fff;margin-top: 18rpx;"
						@click="submit(item.id,item.channel_pid,item.channel_id)">
						发送
					</view>
				</view>
				<view style="width: 100%;height: 200rpx;" v-if="imgList.length > 0 && img_id == item.id">
					<view style="display: inline-block;position: relative;" v-for="(img,index2) in imgList"
						:key="index2">
						<image style="width: 160rpx;height: 160rpx;float: left;padding-left: 20rpx;" :src="img"></image>
						<image style="width: 30rpx;height: 30rpx;position: absolute;top: -15rpx;right: -15rpx;"
							@click="delimg(index2)" src="@/static/close.png"></image>
					</view>
				</view>
				<view style="width:95%;margin:auto;height:5rpx;background-color:#6386b5;margin-top:-20rpx;"></view>
				<view class="flex p-xs margin-bottom-sm mb-sm">
			
					<!-- 					<view class="flex-sub padding-sm margin-xs radius">
						<view class='cuIcon-favorfill text-white' style="color: #F4C044;" @click="uncollect(item.id)"
							v-if="item.is_myfavorite == 1">{{item.post_favorites}}</view>
						<view class='cuIcon-favor text-white' @click="collect(item.id)" v-else>{{item.post_favorites}}
						</view>
					</view> -->
			
					<view class="flex-sub padding-sm margin-xs radius">
						<button open-type="share" @click="share"
							style="padding: 0rpx;background-color: #0d4283;height: 40rpx; display: flex; align-items: center;justify-content: center;">
							<view class='cuIcon-post text-white'></view>
						</button>
					</view>
			
					<view class="flex-sub padding-sm margin-xs radius"
						style="display: flex;align-items: center;justify-content: center;">
						<view class='cuIcon-comment text-white'>{{item.comment_count}}</view>
					</view>
					
					<view class="flex-sub padding-sm margin-xs radius"
						style="display: flex;align-items: center;justify-content: center;">
						<view class='cuIcon-appreciatefill text-white' style="color: #F4C044;"
							@click="uncollect(item.id)" v-if="item.is_myfavorite == 1">{{item.post_favorites}}</view>
						<view class='cuIcon-appreciate text-white' @click="collect(item.id)" v-else>
							{{item.post_favorites}} </view>
					</view>

				</view>
			</view>
			
			
			<view class="cu-modal" :class="modalName3=='menuModal3'?'show':''" @tap="hideModal3">
				<view class="cu-dialog" @tap.stop>
					<view style="padding: 20rpx 0 30rpx 30rpx;font-size: 40rpx;font-weight: 600;">
						修改评论</view>
					<view class="flex p-xs margin-bottom-sm mb-sm" style="">
						<view class="flex-quadruple padding-sm margin-xs radius" style="padding-right: 0;">
							<view class='headimg1'>
								<image style="width: 100%;height: 100%;border-radius: 100rpx;" :src="userinfo.avatar">
								</image>
							</view>
						</view>
			
						<view class="flex-sub padding-sm margin-xs radius" style="padding-left: 0;position: relative;">
							<input class="inputstyle" v-model="text4" placeholder="" style="color:#000000;"></input>
							<image
								style="width: 50rpx;height:50rpx;position: absolute;top:30rpx;right: 30rpx;z-index:999;"
								@click="update_ChooseImage()" src="@/static/upimg.png"></image>
						</view>
			
						<view style="padding: 20rpx 20rpx 0 0;font-size: 40rpx;color: #000000;margin-top: 18rpx;"
							@click="comment_update()">
							发送
						</view>
					</view>
					<view style="width: 100%;height: 200rpx;" v-if="imgListsss.length > 0">
						<view style="display: inline-block;position: relative;" v-for="(img,index4) in imgListsss"
							:key="index4">
							<image style="width: 160rpx;height: 160rpx;float: left;padding-left: 20rpx;" :src="img">
							</image>
							<image style="width: 30rpx;height: 30rpx;position: absolute;top: -15rpx;right: -15rpx;"
								@click="delimg_update(index4)" src="@/static/close.png"></image>
						</view>
					</view>
				</view>
			</view>
			
			<!-- title -->
			<view style="display: flex;flex-wrap: wrap;" v-if="!checkstatus">
				<view class="video_first" @click="broadcast(2,item.id,item.is_member_expire,item.channels_id)" v-for="(item,index) in liveList" :key="index">
					<view class="video_image">
						<image class="video_images" :src="item.image"></image>
					</view>
					<view class="video_info">
						<view class="video_info1"> {{item.title}} </view>
						<view class="video_info2">
							<rich-text style="color: #fff;" :nodes="item.description"></rich-text>
						</view>
						<view class="video_info3">
							￥ {{item.membership_price}}</text>
						</view>
					</view>
				</view>
			</view>
			

			<!-- //成长计划 -->
			<view style="display: flex;flex-wrap: wrap;" v-if="!checkstatus">
				<view class="video_first" @click="plan_details(item.id,item.is_member_expire)" v-for="(item,index) in albumList" :key="index">
					<view class="video_image">
						<image class="video_images" :src="item.cover_image"></image>
					</view>
					<view class="video_info">
						<view class="video_info1"> {{item.name}} </view>
						<view class="video_info2">
							<rich-text style="color: #fff;" :nodes="item.introduction"></rich-text>
						</view>
						<view class="video_info3">
							￥ {{item.membership_price}} <text class="video_info3_text">已卖出{{item.quantity_sold}}件</text>
						</view>
					</view>
				</view>
			</view>

			<!-- //数据库内容 -->
			<view class="square" v-for="(item,index) in investmentList" :key="index">
				<view>发布时间: {{item.content_time}}</view>
				<view style="padding:10rpx 0;">政策面:</view>
				<rich-text style="color: #fff;" :nodes="item.policy_content"></rich-text>
				<view style="padding:10rpx 0;">市场新闻:</view>
				<rich-text style="color: #fff;" :nodes="item.news_content"></rich-text>
				<view style="padding:10rpx 0;">宏观面:</view>
				<rich-text style="color: #fff;" :nodes="item.macro_content"></rich-text>
				<view style="padding:10rpx 0;">资金面及预期:</view>
				<rich-text style="color: #fff;" :nodes="item.fund_content"></rich-text>
				<view style="padding:10rpx 0;">市场预期/关注:</view>
				<rich-text style="color: #fff;" :nodes="item.expect_content"></rich-text>
				<view style="padding:10rpx 0;">情绪面:</view>
				<rich-text style="color: #fff;" :nodes="item.emotion_content"></rich-text>
			</view>
		</view>
	</view>
</template>

<script>
	import user from '@/api/user.js';
	import forum from '@/api/forum.js';
	import {
		img_upload
	} from '@/common/config'
	export default {
		data() {
			return {
				token: '',
				albumList: [],
				investmentList: [],
				liveList: [],
				videoList: [],
				plateList: [],
				type: 1,
				result: 1,
				forum_id: [],
				forum_comment: [],
				//一级评论
				imgList: [],
				imgdata: [],
				file_img: [],
				file_imgs: [],
				img_id: '',
				//二级评论
				imgLists: [],
				imgdatas: [],
				file_imgs: [],
				file_imgss: [],
				img_ids: '',
				//三级评论
				imgListss: [],
				imgdatass: [],
				file_imgss: [],
				file_imgsss: [],
				img_idss: '',
				//修改评论
				imgListsss: [],
				imgdatasss: [],
				file_imgsss: [],
				file_imgssss: [],
				img_idsss: '',
				//上传图片类型 1一级2二级3三级
				img_type: 1,
				comment_page: 1,
				commentText: {},
				page: 2,
				limits: 1,
				pagetype: 1,
				modalName: null,
				modalName1: null,
				modalName2: null,
				modalName3: null,
				swiperList: [],
				herald: [],
				fid: 0,
				fid_type: 'plate',
				dotStyle: false,
				text2: '',
				text3: '',
				text4: '',
				aid: 0,
				pinglun_id: 0,
				keywords: '',
				userinfo: [],
				checkstatus:uni.getStorageSync('checkstatus')
			}
		},
		onLoad() {
			this.userinfo = uni.getStorageSync('userinfo');
			const token = uni.getStorageSync('token');
			this.token = token
			if (token == '') {
				uni.navigateTo({
					url: '/pages/login/login'
				})
			}
		},
		methods: {
			//图片预览
			tankuang(url,arr){
				uni.previewImage({
					current: url,
					urls: arr,
					loop: true,
				});
			},
			//图片上传弹框
			ChooseImage(id, type) {
				uni.chooseImage({
					count: 3, //默认9 
					sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图，默认二者都有
					sourceType: ['album'], //从相册选择
					success: (res) => {
						for (let i = 0; i < res.tempFilePaths.length; i++) {
							this.uploadFile(res.tempFilePaths[i], id, type);
						}
					}
				});
			},
			//图片上传
			uploadFile(filePath, id, type) {
				uni.uploadFile({
					url: img_upload,
					filePath: filePath,
					name: 'file',
					formData: {
						'user': 'test',
						'token': this.token
					},
					success: (uploadRes) => {
						const responseObject = JSON.parse(uploadRes.data);
						if (responseObject.code == 403) {
							uni.showToast({
								title: responseObject.msg,
								icon: 'error'
							})
						} else {
							this.img_type = type
							console.log(type,888)
							if (type == 1) {
								if (this.imgList.length < 3) {
									console.log(responseObject)
									this.imgdata.push(responseObject.data.fullurl)
									this.imgList = this.imgdata
									this.file_imgs.push(responseObject.data.url)
									this.file_img = this.file_imgs
									this.img_id = id
									
									console.log(this.imgList,this.file_img,this.img_id)
								} else {
									uni.showToast({
										title: '最多上传三张照片',
										icon: 'none'
									})
								}
							} else if (type == 2) {
								if (this.imgLists.length < 3) {
									console.log(responseObject)
									this.imgdatas.push(responseObject.data.fullurl)
									this.imgLists = this.imgdatas
									this.file_imgss.push(responseObject.data.url)
									this.file_imgs = this.file_imgss
									this.img_ids = id
									console.log(this.imgLists, this.file_imgs, this.img_ids, 888)
								} else {
									uni.showToast({
										title: '最多上传三张照片',
										icon: 'none'
									})
								}
							} else {
								if (this.imgListss.length < 3) {
									console.log(responseObject)
									this.imgdatass.push(responseObject.data.fullurl)
									this.imgListss = this.imgdatass
									this.file_imgsss.push(responseObject.data.url)
									this.file_imgss = this.file_imgss
									this.img_idss = id
								} else {
									uni.showToast({
										title: '最多上传三张照片',
										icon: 'none'
									})
								}
							}
			
						}
					},
					fail: (error) => {
						console.log(error);
					}
				});
			},
			//修改评论图传上传弹窗
			update_ChooseImage() {
				uni.chooseImage({
					count: 3, //默认9 
					sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图，默认二者都有
					sourceType: ['album'], //从相册选择
					success: (res) => {
						for (let i = 0; i < res.tempFilePaths.length; i++) {
							this.uploadFile1(res.tempFilePaths[i]);
						}
					}
				});
			},
			//修改评论图片上传
			uploadFile1(filePath) {
				uni.uploadFile({
					url: img_upload,
					filePath: filePath,
					name: 'file',
					formData: {
						'user': 'test',
						'token': this.token
					},
					success: (uploadRes) => {
						const responseObject = JSON.parse(uploadRes.data);
						if (responseObject.code == 403) {
							uni.showToast({
								title: responseObject.msg,
								icon: 'error'
							})
						} else {
							if (this.imgList.length < 3) {
								console.log(responseObject)
								this.imgListsss.push(responseObject.data.fullurl)
							} else {
								uni.showToast({
									title: '最多上传三张照片',
									icon: 'none'
								})
							}
						}
					},
					fail: (error) => {
						console.log(error);
					}
				});
			},
			//删除评论时上传的图片
			delimg(e) {
				if (this.img_type == 1) {
					this.file_img.splice(e, 1);
					this.imgList.splice(e, 1);
				} else if (this.img_type == 2) {
					this.file_imgs.splice(e, 1);
					this.imgLists.splice(e, 1);
				} else {
					this.file_imgss.splice(e, 1);
					this.imgListss.splice(e, 1);
				}
			},
			//删除修改时上传的图片
			delimg_update(e) {
				this.imgListsss.splice(e, 1);
			},
			loadMoreData() {
				if (!this.isReachedBottom) {
					this.loadData();
					this.isReachedBottom = true;
					this.refresh_now();
				}
			},
			downloadFiles(index, datafile) {
				uni.downloadFile({
					url: datafile,
					success: (res) => {
						if (res.statusCode === 200) {
							console.log('下载成功', res.tempFilePath);
						} else {
							console.error('下载失败', res.statusCode);
						}
					},
					fail: (error) => {
						console.error('下载失败', error);
					}
				});
			},
			deletePost(item) {
				forum.delPost({
					category_type: item.category_type,
					id: item.id
				}).then(res => {
					if (res.code === 1) {
						uni.showToast({
							title: '删除成功',
							icon: 'success'
						})
						this.initList()
					}
				})
			},
			updatePost(item) {
				uni.navigateTo({
					url: 'updatePost',
				});
				uni.setStorageSync('arrayList', item);
			},
			deleteComment(id) {
				forum.delComment({
					id: id
				}).then(res => {
					if (res.code == 1) {
						uni.showToast({
							title: '删除成功',
							icon: 'success'
						})
						this.initList()
					}
				})
			},
			collect(id) {
				forum.addFavorite({
					token: this.token,
					table_name: 'plate_post',
					object_id: id,
				}).then(res => {
					if (res.code == 1) {
						this.initList()
					}
				})
			},
			uncollect(id) {
				forum.delFavorite({
					token: this.token,
					table_name: 'plate_post',
					object_id: id,
				}).then(res => {
					if (res.code == 1) {
						this.initList()
					}
				})
			},
			//发送一级评论
			submit(wid, pid, id) {
				let text = this.commentText[wid] || '';
				let texts = this.commentText[wid] || '';
				if (this.file_img && this.file_img.length > 0) {
					for (let i = 0; i < this.file_img.length; i++) {
						text += `![Image Description](${this.file_img[i]})` 
					}
				}
				forum.addComment({
					token: this.token,
					type: 'bbs',
					aid: wid,
					content: text,
					con: texts,
					image: this.imgList,
					pid: 0,
					top_pid: 0,
				}).then(res => {
					if (res.code == 1) {
						uni.showToast({
							title: '发布成功',
							icon: 'success'
						})
						this.imgList = []
						this.commentText[wid] = ''
						this.initList()
					}
				})
			},
			showModal(e) {
				this.modalName = e.currentTarget.dataset.target
				forum.get_management({
					token: this.token,
				}).then(res => {
					if (res.code == 1) {
						this.swiperList = res.data
					}
				})
				forum.getLiveForeshow().then(res => {
					if (res.code == 1) {
						this.herald = res.data
					}
				})
			},
			showModal1(aid, id) {
				this.modalName1 = 'menuModal1'
				this.aid = aid
				this.pinglun_id = id
			},
			showModal2(aid, id) {
				this.modalName2 = 'menuModal2'
				this.aid = aid
				this.pinglun_id = id
				console.log(this.aid, this.pinglun_id, 555555)
			},
			showModal3(aid, id, item) {
				this.modalName3 = 'menuModal3'
				this.aid = aid
				this.pinglun_id = id
				this.updateList = item
				this.text4 = item.content_text
				this.imgListsss = item.content_files_img
				console.log(this.aid, this.pinglun_id, 555555)
			},
			hideModal(e) {
				this.modalName = null
			},
			hideModal1(e) {
				this.modalName1 = null
			},
			hideModal2(e) {
				this.modalName2 = null
			},
			hideModal3(e) {
				this.modalName3 = null
			},
			DotStyle(e) {
				this.dotStyle = e.detail.value
			},
			cardSwiper(e) {
				this.cardCur = e.detail.current
			},
			//查看评论
			see_more(id) {
				if (id != this.forum_id) {
					this.comment_page = 1
					this.forum_comment = []
				}
				forum.AlbumComment({
					token: this.token,
					aid: id,
					type: 'bbs',
					page: this.comment_page,
					limit: 5,
				}).then(res => {
					console.log(this.forum_comment)
					if (this.forum_comment.length == 0) {
						for (var i = 0; i < res.data['list'].length; i++) {
							if (res.data['list'][i]['content_files'] != '') {
								const imageUrlArray = res.data['list'][i]['content_files'].split(',');
								res.data['list'][i]['content_files_img'] = imageUrlArray
							} else {
								res.data['list'][i]['content_files_img'] = []
							}
							if (res.data['list'][i]['children'] != []) {
								for (var j = 0; j < res.data['list'][i]['children'].length; j++) {
									if (res.data['list'][i]['children']['content_files'] != '') {
										const imageUrlArrays = res.data['list'][i]['children'][j]['content_files']
											.split(',');
										res.data['list'][i]['children'][j]['content_files_img'] = imageUrlArrays
									} else {
										res.data['list'][i]['children'][j]['content_files_img'] = []
									}
								}
							}
						}
						this.forum_comment = res.data
					} else {
						for (let i = 0; i < res.data['list'].length; i++) {
							if (res.data['list'][i]['content_files'] != '') {
								const imageUrlArray = res.data['list'][i]['content_files'].split(',');
								res.data['list'][i]['content_files_img'] = imageUrlArray
							} else {
								res.data['list'][i]['content_files_img'] = []
							}
							if (res.data['list'][i]['children'] != []) {
								for (var j = 0; j < res.data['list'][i]['children'].length; j++) {
									if (res.data['list'][i]['children']['content_files'] != '') {
										const imageUrlArrayss = res.data['list'][i]['children'][j]['content_files']
											.split(',');
										res.data['list'][i]['children'][j]['content_files_img'] = imageUrlArrayss
									} else {
										res.data['list'][i]['children'][j]['content_files_img'] = []
									}
								}
							}
							this.forum_comment['list'].push(res.data['list'][i])
						}
					}
			
					console.log(this.forum_comment, 666)
			
					this.forum_id = id
					if (res.data.total == 0) {
						this.forum_comment = []
						uni.showToast({
							title: '暂无评论',
							icon: 'none'
						})
					}
				});
				this.comment_page += 1
			},
			search(e) {
				this.result = 2
				this.keywords = e.detail.value
				forum.searchList({
					token: this.token,
					keyword: e.detail.value,
					time: 0,
				}).then(res => {
					if (res.code == 1) {
						if (!res.data.albumList.length && !res.data.investmentList.length && !res.data.liveList
							.length && !res.data.videoList.length && !res.data.plateList.length) {
							this.type = 1;
						} else {
							this.type = 2;
						}
						this.albumList = res.data.albumList
						this.investmentList = res.data.investmentList
						this.liveList = res.data.liveList
						this.videoList = res.data.videoList
						this.plateList = res.data.plateList
					} else {
						this.type = 2;
						this.albumList = []
						this.investmentList = []
						this.liveList = []
						this.videoList = []
						this.plateList = []
					}
				})
			},
			initList(){
				forum.searchList({
					token: this.token,
					keyword: this.keywords,
					time: 0,
				}).then(res => {
					if (res.code == 1) {
						if (!res.data.albumList.length && !res.data.investmentList.length && !res.data.liveList
							.length && !res.data.videoList.length && !res.data.plateList.length) {
							this.type = 1;
						} else {
							this.type = 2;
						}
						this.albumList = res.data.albumList
						this.investmentList = res.data.investmentList
						this.liveList = res.data.liveList
						this.videoList = res.data.videoList
						this.plateList = res.data.plateList
					} else {
						this.type = 2;
						this.albumList = []
						this.investmentList = []
						this.liveList = []
						this.videoList = []
						this.plateList = []
					}
				})
			},
			plan_details(id,is_member_expire){
				if(is_member_expire == 1){
					this.fid = id
					this.fid_type = 'danAlbum'
					uni.setStorageSync('fid',this.fid);
					uni.setStorageSync('fid_type',this.fid_type);
					uni.showModal({
						title: '会员',
						content: '开通会员',
						cancelText: '取消',
						confirmText: '确定',
						success: res => {
							if (res.confirm) {
								uni.navigateTo({
									url: '/pages/membership/membership'
								})
							}
						}
					})
				}else{
					uni.navigateTo({
						url: '/pages/component/plan_details'
					});
					uni.setStorageSync('video_id',id);
				}
			},
			broadcast(type,id,is_member_expire,channels_id) {		
				if(is_member_expire == 1){
					this.fid = id
					this.fid_type = 'danlive'
					uni.setStorageSync('fid',this.fid);
					uni.setStorageSync('fid_type',this.fid_type);
					uni.showModal({
						title: '会员',
						content: '开通会员',
						cancelText: '取消',
						confirmText: '确定',
						success: res => {
							if (res.confirm) {
								uni.navigateTo({
									url: '/pages/membership/membership'
								})
							}
						}
					})
				}else{
					uni.setStorageSync('livetype', type);
					uni.setStorageSync('liveid', id);
					uni.setStorageSync('channels_id', channels_id);
					uni.navigateTo({
						url: '/pages/index/livbroadcast'
					});
				}
			},
			//发送二级评论
			comment_first(aid, id) {
				let text = this.text2;
				let texts = this.text2;
				if (this.file_imgs && this.file_imgs.length > 0) {
					for (let i = 0; i < this.file_imgs.length; i++) {
						text += `![Image Description](${this.file_imgs[i]})`
					}
				}
				forum.addComment({
					token: this.token,
					type: 'bbs',
					aid: aid,
					content: text,
					con: texts,
					image: this.imgLists,
					pid: id,
					top_pid: aid,
				}).then(res => {
					if (res.code == 1) {
						uni.showToast({
							title: '发布成功',
							icon: 'success'
						})
					}
				})
				this.text2 = ''
				this.modalName1 = null
				this.initList()
			},
			//发送三级评论
			comment_second(aid, id) {
				let text = this.text3;
				let texts = this.text3;
				if (this.file_imgss && this.file_imgss.length > 0) {
					for (let i = 0; i < this.file_imgss.length; i++) {
						text += `![Image Description](${this.file_imgss[i]})`
					}
				}
				forum.addComment({
					token: this.token,
					type: 'bbs',
					aid: aid,
					content: text,
					con: texts,
					image: this.imgListss,
					pid: id,
					top_pid: aid,
				}).then(res => {
					if (res.code == 1) {
						this.initList()
						uni.showToast({
							title: '发布成功',
							icon: 'success'
						})
					}
				})
			},
			//修改评论
			comment_update() {
				let text = this.text4;
				let texts = this.text4;
				if (this.imgListsss && this.imgListsss.length > 0) {
					for (let i = 0; i < this.imgListsss.length; i++) {
						text += `![Image Description](${this.imgListsss[i]})`
					}
				}
				forum.updateComment({
					token: this.token,
					id: this.updateList.id,
					content: text,
					con: texts,
					image: this.imgListsss
				}).then(res => {
					if (res.code == 1) {
						uni.showToast({
							title: '修改成功',
							icon: 'success'
						})
						this.initList()
					}
				})
			},
		}
	}
</script>

<style>
	.all {
		width: 100%;
		height: 100vh;
		background-color: #112858;
	}

	.square {
		width: 90%;
		margin: 50rpx auto;
		padding: 50rpx;
		color: #fff;
		background-color: #0d4283;
		border-radius: 15rpx;
	}
	
	.video_first{
		width: 49%;
		height: 500rpx;
		background-color: #163762;
		border-radius: 16rpx;
		border: 4rpx #3077AF solid;
		display: inline-block;
		margin-right: 1%;
		margin-top: 20rpx;
	}
	
	.video_image{
		width: 92%;
		height: 300rpx;
		margin: 15rpx auto;
	}
	
	.video_images{
		width: 100%;
		height: 300rpx;
		border-radius: 16rpx;
	}
	
	.video_info{
		width: 92%;
		height: 150rpx;
		margin: auto;
	}
	.video_info1{
		font-size: 30rpx;
		font-weight: 600;
		color: #fff;
		padding: 5rpx 0 5rpx 10rpx;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}
	.video_info2{
		color: #fff;
		padding: 5rpx 0 5rpx 10rpx;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}
	.video_info3{
		font-size: 30rpx;
		color: #F4C044;
		padding: 5rpx 0 5rpx 10rpx;
	}
	.video_info3_text{
		font-size: 25rpx;
		color: #92A1B5;
		padding: 5rpx 0 5rpx 10rpx;
	}
</style>